package com.tingyuge.base.thread.sync;

public class SyncTest1 {
    public synchronized void test1() throws InterruptedException {
      Thread.sleep(5000);
        System.out.println("Test1.test1");
    }


    public synchronized void test2(){
        System.out.println("Test1.test2");
    }

    public static void main(String[] args) throws InterruptedException {
        SyncTest1 test1 = new SyncTest1();
        test1.test1();
        new Thread(()->{
            test1.test2();
        }).start();
    }
}
